<template>
    <div class="tabbar">

        <div class="tabbarBox">
            <div class="tabsItem" :class="currIndex == 0 ? 'tabsItemed' : ''" @click="handleHome(0)">
                <img v-if="currIndex == 0" class="tabimg" src="../../static/imgs/homed.png" alt="">
                <img v-else class="tabimg" src="../../static/imgs/home.png" alt="">
                <div>
                    {{ $t('assemble.首页') }}
                </div>
            </div>
            <div class="tabsItem" :class="currIndex == 1 ? 'tabsItemed' : ''" @click="handleOrder(1)">
                <img v-if="currIndex == 1" class="tabimg" src="../../static/imgs/orderd.png" alt="">
                <img v-else class="tabimg" src="../../static/imgs/order.png" alt="">
                <div>
                    {{ $t('assemble.订单管理') }}
                </div>
            </div>
            <div class="tabsItem" :class="currIndex == 2 ? 'tabsItemed' : ''" @click="handleMine(2)">
                <img v-if="currIndex == 2" class="tabimg" src="../../static/imgs/mined.png" alt="">
                <img v-else class="tabimg" src="../../static/imgs/mine.png" alt="">
                <div>
                    {{ $t('assemble.我的') }}
                </div>
            </div>

        </div>

    </div>
</template>
<script>

export default {
    components: {

    },
    data() {
        return {
            currIndex: null,
            lang: 'zh',
        }
    },
    created() {
        this.$i18n.locale = localStorage.getItem('langtype')
        this.lang = localStorage.getItem('langtype')
    },
    mounted() {
        // this.getyinsi()
        this.currIndex = localStorage.getItem('currIndex')
    },
    methods: {
        handleHome(index) {
            localStorage.setItem('currIndex', index)
            this.$router.push({ path: '/pages/home/index', })
        },
        handleOrder(index) {
            localStorage.setItem('currIndex', index)
            this.$router.push({ path: '/pages/order/index' })
        },
        handleMine(index) {
            localStorage.setItem('currIndex', index)
            this.$router.push({ path: '/pages/mine/index' })
        },
    },

}
</script>

<style scoped lang="scss">
.tabbar {}

@media screen and (max-width: 750px) {
    .tabbarBox {
        width: 100%;
        position: fixed;
        bottom: 0;
        display: flex;
        justify-content: space-between;
        padding-bottom: 10px;
        padding-top: 5px;
        background-color: #ffffff;


        .tabsItem {
            width: 33.33%;
            text-align: center;
            font-family: PingFang SC, PingFang SC;
            font-weight: 400;
            font-size: 10px;
            color: #B1B1B1;
            line-height: 12px;
            text-align: center;
            font-style: normal;
            text-transform: none;

            .tabimg {
                width: 28px;
                height: 28px;
            }
        }

        .tabsItemed {
            color: #E00000;
        }
    }
}

@media screen and (min-width: 751px) and (max-width: 1300px) {
    .tabbarBox {
        width: 100%;
        position: fixed;
        bottom: 0;
        display: flex;
        justify-content: space-between;
        background-color: #ffffff;


        .tabsItem {
            width: 33.33%;
            text-align: center;
            padding-bottom: 20px;
            padding-top: 10px;
            font-family: PingFang SC, PingFang SC;
            font-weight: 400;
            font-size: 20px;
            color: #B1B1B1;
            line-height: 12px;
            text-align: center;
            font-style: normal;
            text-transform: none;

            .tabimg {
                width: 60px;
                height: 60px;
                margin-bottom: 10px;
            }
        }

        .tabsItemed {
            color: #E00000;
        }
    }
}
</style>